<link rel="import" href="../../../../packages/polymer/polymer.html">
<link rel="import" href="instance_ref.html">
<link rel="import" href="observatory_element.html">

<polymer-element name="action-link" extends="observatory-element">
  <template>
    <style>
      .idle {
        color: #0489c3;
        cursor: pointer;
        text-decoration: none;
      }
      .idle:hover {
        text-decoration: underline;
      }
      .busy {
        color: #aaa;
        cursor: wait;
        text-decoration: none;
      }
    </style>

    <template if="{{ busy }}">
      <span class="busy">[{{ label }}]</span>
    </template>
    <template if="{{ !busy }}">
      <template if="{{ color == null }}">
        <span class="idle"><a on-click="{{ doAction }}">[{{ label }}]</a></span>
      </template>
      <template if="{{ color != null }}">
        <span class="idle" style="color:{{ color }}"><a on-click="{{ doAction }}">[{{ label }}]</a></span>
      </template>
    </template>
  </template>
</polymer-element>

<script type="application/dart" src="action_link.dart"></script>
